Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom make args #59

Merged
merged 1 commit into from
May 16, 2024
Merged

Add custom make args #59

merged 1 commit into from
May 16, 2024

Conversation

AetiasHax
Copy link
Contributor

A custom_make option such as make MY_VALUE=1 is interpreted as an entire command with no arguments. So, to allow for custom arguments, I've added a custom_args option.

I hope the README example makes sense, I haven't used Ninja before 🙃

@encounter
Copy link
Owner

Thanks for this! This feature is long overdue.

For more flexibility, I was considering making this a part of custom_make. My idea is that it would accept something like:

custom_make: ninja -C build %o

It could parse the command line (honoring shell parsing rules, like quotes, there’s something in std or a crate to do this) and perform any replacements (%o for “object” or “output”).

Of course, the “replacements” idea could also be done with the custom_args array, so the difference is mainly aesthetic.

Do you have any thoughts on this?

@encounter
Copy link
Owner

Actually, after thinking about it, I think it makes most sense the way you implemented it with custom_args. Thanks for the contribution!

@encounter encounter merged commit b457453 into encounter:main May 16, 2024
10 checks passed
@AetiasHax
Copy link
Contributor Author

Do you have any thoughts on this?

I agree, it's possible that some build systems require arguments after the file being built.

The %o solution could work, but maybe it's too flexible? If all we need is to support custom arguments before and after the target file, then a custom_args_post (or better name) would suffice.

On the other hand, if replacement patterns other than %o are desirable, then custom_args_post would not suffice and the %o solution is the better alternative, imo.

@AetiasHax AetiasHax deleted the custom-args branch May 16, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants